package com.eiei.thread;

import org.apache.log4j.Logger;

/**
 * 线程基础类
 * @author eiei
 * @since 2013-06-26
 */
public class BaseThread extends Thread{
	
	private static final Logger logger = Logger.getLogger(BaseThread.class);

	/**
	 * 线程的状态：挂起
	 */
	public static final int HANG_UP = -1;
	
	/**
	 * 线程的状态：运行
	 */
	public static final int RUNNING = 1 ;
	
	/**
	 * 线程的状态：消亡
	 */
	public static final int DIE_OUT = 0;
	
	/**
	 * 线程名称
	 */
	protected String threadName;
	
	/**
	 * 运行状态
	 */
	protected int runStat;
	
	public static void threadSleep(int second){
		if(second > 0 ){
			for(int i=0;i<second;i++){
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					logger.error("睡眠报错。");
				}
			}
		}
		
	}
	
	
	
}
